Skip to content

Pro 7808 image widget upload (#5009) - #5021

Merged
boutell merged 12 commits into
mainfrom
feature/quick-image-upload
Aug 13, 2025
Merged

Pro 7808 image widget upload (#5009)#5021
boutell merged 12 commits into
mainfrom
feature/quick-image-upload

Conversation

@ValJed

@ValJed ValJed commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

Summary

Feature quick image upload

What are the specific steps to test this change?

See designs.
Cypress 🟢

What kind of change does this PR introduce?

New image widget with quick image upload.

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@ValJed ValJed self-assigned this Jul 31, 2025
@ValJed
ValJed marked this pull request as draft July 31, 2025 07:39
ValJed and others added 2 commits August 5, 2025 15:42
* configs image-widget to use AposImageWidget
* Create and use AposMediaUploaderUi
* removes unused methods in media manager uploader
* en translations
* style during dragging
* wraps AposWidget shared logic to be reused in mixin and composable without too much duplication
* allow update from media manager, validates image against minSize before to upload
* adds up to size limit to image drag zone
* adds max size option and translation in quick upload drag and drop

---------

Co-authored-by: Stuart Romanek <stuart@apostrophecms.com>
* Supports placeholder with new UI
* Forces option placeholder to be true to avoid unexpected bugs, user still can disable it (handed internally)
* Drag and drop style with placeholder
* Remove label and better handling of all events in image uploader UI
@ValJed
ValJed force-pushed the feature/quick-image-upload branch from 12a471c to ed66b31 Compare August 5, 2025 13:43
@ValJed
ValJed force-pushed the feature/quick-image-upload branch from e14b312 to d24936a Compare August 6, 2025 10:07
@ValJed ValJed changed the title Pro 7808 image widget upload (#5009) [DO NOT MERGE] Pro 7808 image widget upload (#5009) Aug 13, 2025
console.warn(`No ${moduleName} module found for widget type ${this.widget.type}`);
}
return module.label;
return mod.label;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should avoid using reserved words.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a reserved word. Has significance in nodejs, but that doesn't stop us from using it in local functions that don't need access to module, and this isn't node.js.

No biggie though!

}
event.preventDefault();
this.dragging = true;
},

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused method

@ValJed
ValJed marked this pull request as ready for review August 13, 2025 14:27
@ValJed
ValJed requested a review from boutell August 13, 2025 14:27
boutell
boutell previously approved these changes Aug 13, 2025

@boutell boutell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the way you made widgets friendly to the composition API without duplicating code between that and legacy components that use the options API.

console.warn(`No ${moduleName} module found for widget type ${this.widget.type}`);
}
return module.label;
return mod.label;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a reserved word. Has significance in nodejs, but that doesn't stop us from using it in local functions that don't need access to module, and this isn't node.js.

No biggie though!

import { isEqual } from 'lodash';
import props from '../composables/AposWidgetProps.js';
import {
_renderContent, _emitWidgetRendered, _getClasses

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... The underscores are here to avoid naming conflicts in useAposWidget. OK.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I thought it was clear to have a separation between logic functions and component functions that use the logic functions.

@boutell
boutell merged commit beb4599 into main Aug 13, 2025
6 checks passed
@boutell
boutell deleted the feature/quick-image-upload branch August 13, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants